package lesson2.example2;

import java.io.IOException;

import javax.tools.ToolProvider;

public class RunNameCheckProcessor {
	public static void main(String args[]) throws IOException {
		String commonPath = "/Users/mazhi/Workspace/eclipse/eclipse_workspace/live-class/";
		String str = commonPath + "/src/test/java/lesson2/example2/TEST.java";
		
		javax.tools.JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
		int results = compiler.run(null, null, null, new String[]{
				"-processor","lesson2.example2.NameCheckProcessor",
				"-processorpath",commonPath+"/src/test/java",
				"-d",commonPath+"/output",
				str
		});
		System.out.println("Result code: " + results);
	}
}
